#include<iostream>
using namespace std;
const int N = 100010;
int n, m;
int c;
int arr[N];
int d[N];
int sum[N];
int main()
{
	cin >> n >> m;
	for (int i = 1; i < n + 1; i++) {
		cin >> arr[i];
	}
	while (m--) {
		int l, r, c;
		cin >> l >> r >> c;
		d[l] += c;
		d[r + 1] -= c;
	}
	for (int i = 1; i < n + 1; i++)
	{
		sum[i] = sum[i - 1] + d[i];
	}
	for (int i = 1; i < n + 1; i++)
	{
		cout << arr[i] + sum[i] << " ";
	}
	return 0;
}